Using memory mapped loading

When running your Kanzi application on an operating system that supports memory mapping of files, you can enable memory mapped loading for the kzb files your Kanzi application uses. When you enable memory mapped loading you can reduce the loading times of your Kanzi application because it reduces the amount of file accesses.

Memory mapping of files is supported, for example, on Windows, Linux, and QNX operating systems, but Android does not support memory mapping of files. Before enabling memory mapped loading, check that it is supported on the platform running your Kanzi application.

To check whether memory mapped loading is supported on your platform, call the kzsMemoryMappedFileIsSupported() function. The function returns True if memory mapped loading is supported, and False if it is not supported.

If you enable memory mapped loading on a platform that does not support this feature, Kanzi shows a warning and uses regular file access for loading the kzb files.

By default memory mapped loading is disabled.

Enabling memory mapped loading

To enable memory mapped loading set in application.cfg

UseMemoryMappedLoading = 1

or set in kzApplicationConfigure()

configuration->useMemoryMappedLoading = KZ_TRUE;

See also

Debugging application memory

Running Kanzi applications in multithread environments

Using memory managers

Memory management best practices

Best practices

Reference for application configuration